import axios from '@/api/fetch';
//import * as types from './types';
import SERVER from '@/api/server';
//特殊车辆非保修配件类型查询-主机厂
//特殊车辆非保修配件类型查询-主页面查询
export const getListByPage = params => axios.post(`${SERVER.CLAIMDEALER}/rpNonWarrantyOil/getListByPage`, params);

//新增的保存
export const newSave = params => axios.post(`${SERVER.CLAIMDEALER}/rpNonWarrantyOil/saveOne`,  params );
//修改回显
export const quyrpNonWarrantyOil = (id, params) => axios.get(`${SERVER.CLAIMDEALER}/rpNonWarrantyOil/selectById/${id}`, { params });
//编辑的保存
export const editSave = params => axios.post(`${SERVER.CLAIMDEALER}/rpNonWarrantyOil/updateByPtId`,  params );
//主页面的单条删除
export const deleteOne = (id, params) => axios.post(`${SERVER.CLAIMDEALER}/rpNonWarrantyOil/updateStatusById/${id}`,{params} );
//export const deleteOne = (id, params) => axios.post(`${SERVER.CLAIMDEALER}/rPPreAuth/updateStatusById/${id}`,{params} );
//导出模版
export const downloadModel = params => {
  const url = `${SERVER.CLAIMDEALER}/rpNonWarrantyOil/exportModel`;
  return axios({
    url,
    method: 'post',
    responseType: 'blob'
  });
};
//导出
export const getListForExport = (params) => axios.post(`${SERVER.CLAIMDEALER}/rpNonWarrantyOil/getListForExport`, params, {
  responseType: 'blob'
});
  //下载中心导出
  export const exporturl = params => axios.post(`/api/cmscloud.excel/downloadExcel/exportExcel/${params.CODE}`, params);







//新增弹窗-数据保存
export const addOrders = params => axios.post(`${SERVER.CLAIMDEALER}/rPPtType/saveList`, params);

//配件类型查询
export const selectListByPage = params => axios.get(`${SERVER.CLAIMDEALER}/rPPtType/getListByPage`,params);



//字典
export const getPartType = (params) => axios.get(`${SERVER.CLAIMDEALER}/const/getBaseDataByType`, {params});

//获取配件
export const getPartList = params =>
  axios.get(`${SERVER.CLAIMDEALER}/const/getPartList`, {
    params
  });
